import request from '@/utils/request'

// 查询教师管理列表
export function listTeacherManagement() {
  return request({
    url: '/teacher/teacherManagement/list',
    method: 'get',
  })
}

// 查询学生信息列表
export function listStudentMessage() {
  return request({
    url: '/student/studentMessage/list',
    method: 'get',
  })
}

// 查询班级管理列表
export function listClass() {
  return request({
    url: '/student/class/list',
    method: 'get',
  })
}

// 查询留级管理列表
export function listRepetition(query) {
  return request({
    url: '/eduadmin/repetition/list',
    method: 'get',
    params: query
  })
}

// 查询留级管理详细
export function getRepetition(id) {
  return request({
    url: '/eduadmin/repetition/' + id,
    method: 'get'
  })
}

// 查询任务列表
export function getTaskRepetition(id) {
  return request({
    url: '/eduadmin/repetition/task/' + id,
    method: 'get'
  })
}

// 新增任务
export function addTask(data) {
  return request({
    url: '/eduadmin/task',
    method: 'post',
    data: data
  })
}

//addTaskRepetition
// 新增留级管理
export function addTaskRepetition(data) {
  return request({
    url: '/eduadmin/repetition',
    method: 'post',
    data: data
  })
}

export function addRepetition(data) {
  return request({
    url: '/eduadmin/repetition',
    method: 'post',
    data: data
  })
}

// 修改留级管理
export function updateRepetition(data) {
  return request({
    url: '/eduadmin/repetition',
    method: 'put',
    data: data
  })
}

// 删除留级管理
export function delRepetition(id) {
  return request({
    url: '/eduadmin/repetition/' + id,
    method: 'delete'
  })
}

// 根据班级id查询学生
export function getStudentByClassId() {
  return request({
    url: '/student/studentMessage/findStudentNameByClassId',
    method: 'get'
  })
}

// 查询历史记录
export function getStudentTaskRecord(id) {
  return request({
    url: '/eduadmin/task/' + id,
    method: 'get'
  })
}

export function findTaskList(id) {
  return request({
    url: '/eduadmin/task/list/' + id,
    method: 'get',
  })
}

export function update(row) {
  return request({
    url: '/eduadmin/task/',
    method: 'put',
    data: row,
  })
}
